package Day34;

import java.util.Scanner;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-11-03
 * Time: 19:56
 * To BE A Better Person-2020-3-2
 */
import java.util.*;
public class TestDemo {
    private static boolean ContainDot(String name){
        for (int i = 0; i < name.length(); i++) {
            if(name.charAt(i) == ','){
                return true;
            }
        }
        return false;
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while(sc.hasNextInt()){
            int num=sc.nextInt();
            sc.nextLine();


                String[] names=new String[num];
                for (int i = 0; i < num; i++) {
                    names[i]=sc.nextLine();
                }
                for (int i = 0; i < names.length; i++) {
                    if (ContainDot(names[i])){
                        System.out.print("\""+names[i]+"\"");

                    }else{
                        System.out.print(names[i]);

                    }
                    if(i!=names.length-1){
                        System.out.print(",");
                    }
                }


            }
        }

    }

